import afterSaleApi from "@/api/declaration/mall/afterSaleApi"
import httpRequest from "@/config/axios/httpRequest"


// 获得交易售后分页
export const getAfterSalePage = async (params) => {
  return await httpRequest.get(afterSaleApi.GetAfterSalePage, params)
}

// 获得交易售后详情
export const getAfterSale = async (id: any) => {
  return await httpRequest.get(afterSaleApi.GetAfterSale, { params: { id } })
}

// 同意售后
export const agree = async (id: any) => {
  return await httpRequest.get(afterSaleApi.Agree, { params: { id } })
}

// 拒绝售后
export const disagree = async (data: any) => {
  return await httpRequest.put(afterSaleApi.Disagree, data)
}

// 确认收货
export const receive = async (id: any) => {
  return await httpRequest.put(afterSaleApi.Receive, { id })
}

// 拒绝收货
export const refuse = async (id: any) => {
  return await httpRequest.put(afterSaleApi.Refuse, { id })
}

// 确认退款
export const refund = async (id: any) => {
  return await httpRequest.put(afterSaleApi.Refund, { id })
}
